View Javadoc

1   /*
2    * jGuild Project: jRPM
3    * Released under the Apache License ( http://www.apache.org/LICENSE )
4    */
5   package com.jguild.jrpm.io.constant;
6   
7   
8   /***
9    *
10   *
11   * @author kuss
12   */
13  /***
14   * Constants for Architecture type.
15   *
16   * @version $Id: LeadArchitecture.java,v 1.3 2003/10/20 16:32:12 mkuss Exp $
17   */
18  public final class LeadArchitecture implements EnumIf {
19      public static final LeadArchitecture UNKNOWN = new LeadArchitecture(_UNKNOWN, "UNKNOWN");
20      public static final int _I386 = 1;
21      public static final LeadArchitecture I386 = new LeadArchitecture(_I386, "i386");
22      public static final int _ALPHA = 2;
23      public static final LeadArchitecture ALPHA = new LeadArchitecture(_ALPHA, "Alpha");
24      public static final int _SPARC = 3;
25      public static final LeadArchitecture SPARC = new LeadArchitecture(_SPARC, "Sparc");
26      public static final int _MIPS = 4;
27      public static final LeadArchitecture MIPS = new LeadArchitecture(_MIPS, "MIPS");
28      public static final int _POWERPC = 5;
29      public static final LeadArchitecture POWERPC = new LeadArchitecture(_POWERPC, "PowerPC");
30      public static final int _A68000 = 6;
31      public static final LeadArchitecture A68000 = new LeadArchitecture(_A68000, "68000");
32      public static final int _SGI = 7;
33      public static final LeadArchitecture SGI = new LeadArchitecture(_SGI, "SGI");
34      public static final int _RS6000 = 8;
35      public static final LeadArchitecture RS6000 = new LeadArchitecture(_RS6000, "RS6000");
36      public static final int _IA64 = 9;
37      public static final LeadArchitecture IA64 = new LeadArchitecture(_IA64, "IA64");
38      public static final int _SPARC64 = 10;
39      public static final LeadArchitecture SPARC64 = new LeadArchitecture(_SPARC64, "Sparc64");
40      public static final int _MIPSEL = 11;
41      public static final LeadArchitecture MIPSEL = new LeadArchitecture(_MIPSEL, "Mipsel");
42      public static final int _ARM = 12;
43      public static final LeadArchitecture ARM = new LeadArchitecture(_ARM, "ARM");
44      public static final int _M68KMINT = 13;
45      public static final LeadArchitecture M68KMINT = new LeadArchitecture(_M68KMINT, "m68kmint");
46      public static final int _S390 = 14;
47      public static final LeadArchitecture S390 = new LeadArchitecture(_S390, "S/390");
48      public static final int _S390X = 15;
49      public static final LeadArchitecture S390X = new LeadArchitecture(_S390X, "S/390x");
50      private EnumIf delegate;
51  
52      private LeadArchitecture(int architecture, String name) {
53          delegate = new EnumDelegate(LeadArchitecture.class, architecture, name, this);
54      }
55  
56      /***
57       * Get a enum by id
58       *
59       * @param id The id of the enum
60       * @return The enum object
61       */
62      public static EnumIf getEnumById(long id) {
63          return EnumDelegate.getEnumById(LeadArchitecture.class, id);
64      }
65  
66      /***
67       * Get a enum by name
68       *
69       * @param name The name of the enum
70       * @return The enum object
71       */
72      public static EnumIf getEnumByName(String name) {
73          return EnumDelegate.getEnumByName(LeadArchitecture.class, name);
74      }
75  
76      /***
77       * Get all defined enums of this class
78       *
79       * @return An array of all defined enum objects
80       */
81      public static String[] getEnumNames() {
82          return EnumDelegate.getEnumNames(LeadArchitecture.class);
83      }
84  
85      /***
86       * Get a enum of this class by id
87       *
88       * @param architecture The id
89       * @return The enum object
90       */
91      public static LeadArchitecture getLeadArchitecture(int architecture) {
92          return (LeadArchitecture) getEnumById(architecture);
93      }
94  
95      /***
96       * Check if this enum class contains a enum of a specified id
97       *
98       * @param id The id of the enum
99       * @return TRUE if the enum is defined in this class
100      */
101     public static boolean containsEnumId(Long id) {
102         return EnumDelegate.containsEnumId(LeadArchitecture.class, id);
103     }
104 
105     /*
106      * @see com.jguild.jrpm.io.constant.EnumIf#getId()
107      */
108     public long getId() {
109         return delegate.getId();
110     }
111 
112     /*
113      * @see com.jguild.jrpm.io.constant.EnumIf#getName()
114      */
115     public String getName() {
116         return delegate.getName();
117     }
118 
119     /*
120      * @see java.lang.Object#toString()
121      */
122     public String toString() {
123         return delegate.toString();
124     }
125 }